// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   About.java

package org.quickserver.net.server.gui;

import java.awt.*;
import java.io.IOException;
import java.io.PrintStream;
import javax.swing.*;
import org.quickserver.net.server.QuickServer;
import org.quickserver.swing.JFrameUtilities;
import org.quickserver.util.TextFile;

public class About extends JPanel
{

    public About()
    {
        classLoader = getClass().getClassLoader();
        logo = new ImageIcon(classLoader.getResource("icons/logo.gif"));
        logoAbout = new ImageIcon(classLoader.getResource("icons/logo.png"));
        ball = new ImageIcon(classLoader.getResource("icons/ball.gif"));
        productName = new JLabel("<html><font style=\"font-size:35pt;color:#535353\" face=\"Verdana\"><b> QuickServer</b></font>", logoAbout, 0);
        readme = new JTextArea();
        html = "<html><font face=\"verdana\" size=\"2\">";
        versionText = new JLabel((new StringBuilder(String.valueOf(html))).append("Version").toString(), ball, 2);
        version = new JLabel((new StringBuilder(String.valueOf(html))).append(": ").append(QuickServer.getVersion()).toString(), 2);
        licenseText = new JLabel((new StringBuilder(String.valueOf(html))).append("License").toString(), ball, 2);
        license = new JLabel((new StringBuilder(String.valueOf(html))).append(": GNU Lesser General Public License").toString(), 2);
        copyrightText = new JLabel((new StringBuilder(String.valueOf(html))).append("Copyright &copy; QuickServer.org").toString(), ball, 2);
        websiteText = new JLabel((new StringBuilder(String.valueOf(html))).append("Website").toString(), ball, 2);
        website = new JLabel((new StringBuilder(String.valueOf(html))).append(": http://www.quickserver.org").toString(), 2);
        readmeText = new JLabel((new StringBuilder(String.valueOf(html))).append("ReadMe").toString(), ball, 2);
        gbc = new GridBagConstraints();
        Container cp = this;
        topPanel = new JPanel();
        topPanel.setLayout(new GridBagLayout());
        gbc.insets = new Insets(2, 2, 2, 2);
        gbc.weighty = 0.0D;
        gbc.weightx = 0.0D;
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.gridheight = 1;
        gbc.gridwidth = 3;
        gbc.anchor = 10;
        gbc.fill = 0;
        topPanel.add(productName, gbc);
        gbc.anchor = 17;
        gbc.fill = 2;
        gbc.gridy++;
        gbc.gridx = 0;
        gbc.weightx = 0.0D;
        topPanel.add(versionText, gbc);
        gbc.gridx = 1;
        topPanel.add(version, gbc);
        gbc.gridx = 2;
        gbc.weightx = 1.0D;
        gbc.fill = 2;
        topPanel.add(Box.createHorizontalGlue(), gbc);
        gbc.gridy++;
        gbc.gridx = 0;
        gbc.weightx = 0.0D;
        topPanel.add(licenseText, gbc);
        gbc.gridx = 1;
        topPanel.add(license, gbc);
        gbc.gridx = 2;
        gbc.weightx = 1.0D;
        gbc.fill = 2;
        topPanel.add(new JLabel(), gbc);
        gbc.gridy++;
        gbc.gridx = 0;
        gbc.weightx = 0.0D;
        topPanel.add(websiteText, gbc);
        gbc.gridx = 1;
        topPanel.add(website, gbc);
        gbc.gridx = 2;
        gbc.weightx = 1.0D;
        gbc.fill = 2;
        topPanel.add(Box.createHorizontalGlue(), gbc);
        gbc.gridy++;
        gbc.gridx = 0;
        gbc.weightx = 0.0D;
        gbc.gridwidth = 2;
        topPanel.add(copyrightText, gbc);
        gbc.gridwidth = 1;
        gbc.gridx = 2;
        gbc.weightx = 1.0D;
        gbc.fill = 2;
        topPanel.add(Box.createHorizontalGlue(), gbc);
        gbc.gridy++;
        gbc.gridx = 0;
        gbc.weightx = 0.0D;
        gbc.gridwidth = 1;
        topPanel.add(readmeText, gbc);
        gbc.gridx = 1;
        topPanel.add(new JLabel(" "), gbc);
        gbc.gridx = 2;
        gbc.weightx = 1.0D;
        gbc.fill = 2;
        topPanel.add(Box.createHorizontalGlue(), gbc);
        centerPanel = new JPanel();
        readme.setText("Loading... readme");
        try
        {
            String cont = TextFile.read("/README.md", this);
            readme.setText(cont);
        }
        catch(IOException e)
        {
            System.err.println((new StringBuilder("Error reading README.md ")).append(e).toString());
            readme.append((new StringBuilder("\r\nFailed : ")).append(e.getMessage()).toString());
        }
        readme.setEditable(false);
        readme.setLineWrap(true);
        readme.setWrapStyleWord(true);
        jsp = new JScrollPane(readme);
        centerPanel.setLayout(new BorderLayout());
        centerPanel.add(jsp);
        centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 9, 0, 9));
        cp.setLayout(new BorderLayout(0, 10));
        cp.add(topPanel, "North");
        cp.add(centerPanel, "Center");
        setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    }

    public static void showAbout()
    {
        try
        {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }
        catch(Exception exception) { }
        About about = new About();
        JFrame frame = new JFrame("About QuickServer");
        frame.setDefaultCloseOperation(3);
        frame.getContentPane().add(about);
        frame.setSize(600, 500);
        frame.setIconImage(about.logo.getImage());
        JFrameUtilities.centerWindow(frame);
        frame.setVisible(true);
    }

    public static void main(String args[])
    {
        EventQueue.invokeLater(new Runnable() {

            public void run()
            {
                About.showAbout();
            }

        }
);
    }

    private ClassLoader classLoader;
    public ImageIcon logo;
    public ImageIcon logoAbout;
    public ImageIcon ball;
    private JPanel centerPanel;
    private JPanel topPanel;
    private JLabel productName;
    private JTextArea readme;
    private JScrollPane jsp;
    String html;
    private JLabel versionText;
    private JLabel version;
    private JLabel licenseText;
    private JLabel license;
    private JLabel copyrightText;
    private JLabel websiteText;
    private JLabel website;
    private JLabel readmeText;
    private GridBagConstraints gbc;
}
